<?php

class Soul_Template_Resource{

    private $_referenceScripts = array();
    private $_startupScripts = array();
    private $_scriptBlocks = array();	
    private $_referenceCss = array();
    private $_cssBlocks = array();
    
    private function __construct(){}
    
    public function getReferenceScripts(){
    	return $this->_referenceScripts;
    }
    
    public function addReferenceScript($name, $src){
    	$this->_referenceScripts[$name] = $src;
    	return $this;
    }
    
    public function removeRefernceScript($name){
    	if(isset($this->_referenceScripts[$name])){
    		unset($this->_referenceScripts[$name]);
    	}
    	return $this;
    }    
    
    public function getStartupScripts(){
    	return $this->_startupScripts;
    }
    
    public function addStartupScript($script){
    	$this->_startupScripts[] = $script;
    	return $this;
    }     

    public function getScriptBlocks(){
    	return $this->_scriptBlocks;
    }    

    public function addScriptBlock($script){
    	$this->_scriptBlocks[] = $script;
    	return $this;
    }
    
    public function getReferenceCss(){
    	return $this->_referenceCss;
    }

    public function addReferenceCss($name, $src){
    	$this->_referenceCss[$name] = $src;
    	return $this;
    }
    
    public function getCssBlocks(){
    	return $this->_cssBlocks;
    }

    public function addCssBlock($css){
    	$this->_cssBlocks[] = $css;
    	return $this;
    }    
    
    private static $_instance = NULL;
    public static function getInstance(){
    	if(is_null(self::$_instance)){
    		self::$_instance = new self();
    	}
    	return self::$_instance;
    }
}